package com.itheima_02;

import java.io.IOException;
import java.net.*;
import java.util.Scanner;

public class ClientTest {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        String s="";
        DatagramSocket socket = new DatagramSocket();//创建对象
        do {
            s = sc.nextLine();
            byte[] bytes = s.getBytes();
            InetAddress address = InetAddress.getByName("192.168.14.34");
            int port = 10000;
            DatagramPacket packet = new DatagramPacket(bytes,bytes.length,address,port);//打包

            socket.send(packet);//发送
        } while (!s.equals("886"));
        socket.close();
    }
}
